package ve.ejb.entity;

import ve.ejb.metadata.Settings;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author memozac
 */
@Entity
public class MapSettings implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long idMapSettings;

    @ManyToOne
    @JoinColumn(name="idSettings",nullable=false,updatable=true)
    private Settings settings;

    @ManyToOne
    @JoinColumn(name="idMap",nullable=false,updatable=true)
    private Map map;

    @Temporal(value = TemporalType.TIMESTAMP) private Date registerDate;

    private Double x;
    
    private Double y;

    public Date getRegisterDate() {
        return registerDate;
    }

    public void setRegisterDate(Date registerDate) {
        this.registerDate = registerDate;
    }

    public Double getX() {
        return x;
    }

    public void setX(Double x) {
        this.x = x;
    }

    public Double getY() {
        return y;
    }

    public void setY(Double y) {
        this.y = y;
    }

    public Long getIdMapSettings() {
        return idMapSettings;
    }

    public Map getMap() {
        return map;
    }

    public void setMap(Map map) {
        this.map = map;
    }

    public Settings getSettings() {
        return settings;
    }

    public void setSettings(Settings settings) {
        this.settings = settings;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idMapSettings != null ? idMapSettings.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof MapSettings)) {
            return false;
        }
        MapSettings other = (MapSettings) object;
        if ((this.idMapSettings == null && other.idMapSettings != null) || (this.idMapSettings != null && !this.idMapSettings.equals(other.idMapSettings))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ve.ejb.entity.MapSettings[id=" + idMapSettings + "]";
    }

}//ends of class